# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Examples:
#
#   movies = Movie.create([{ name: 'Star Wars' }, { name: 'Lord of the Rings' }])
#   Character.create(name: 'Luke', movie: movsies.first)

admin_user = AdminUser.find_or_create_by("account_number"=>"admin", "name"=>"seven", "password"=>"admin")
company = Company.create_with("name"=>" 大连XXX公司", "logo"=>"943c564b155d13775f5d52cc79d7b4a5.jpeg", "address"=>"辽宁省大连市", "content"=>"<p>\r\n\t公司创始于2022年，致力于青年才俊的发展。\r\n</p>\r\n<p>\r\n\t<img src=\"http://localhost:3000/uploads/image/202204/42a628a454d3.png\" alt=\"\" /> \r\n</p>", "brief"=>"很牛", "used"=>true).find_or_create_by("admin_user_id"=> admin_user.id)

array = [
  {key: 'myPage', name: "首页", admin_user_id: admin_user.id, company_id: company.id, order_number: 1},
  {key: 'priorities', name: "技术核心", admin_user_id: admin_user.id, company_id: company.id, order_number: 2},
  {key: 'portfolio', name: "合作伙伴", admin_user_id: admin_user.id, company_id: company.id, order_number: 3},
  {key: 'about', name: "关于我们", admin_user_id: admin_user.id, company_id: company.id, order_number: 4},
  {key: 'team', name: "团队", admin_user_id: admin_user.id, company_id: company.id, order_number: 5},
  {key: 'contact', name: "联系我们", admin_user_id: admin_user.id, company_id: company.id, order_number: 6}
]
array.each do |hash|
  NavigaBar.find_or_create_by(hash)
end